﻿using System;
using System.IO;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;

namespace TwitterViewer
{
	public partial class Login
	{
        private Properties.Settings AppSettings = Properties.Settings.Default;

		public Login()
		{
			this.InitializeComponent();

            UsernameTextBox.Focus();
			
			// Insert code required on object creation below this point.
		}

        private void LoginButton_Click(object sender, RoutedEventArgs e)
        {
            AppSettings.Username = UsernameTextBox.Text;
            AppSettings.Password = PasswordTextBox.Password;
            AppSettings.LastUpdated = string.Empty;

            AppSettings.Save();

            this.DialogResult = true;
            this.Close();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            AppSettings.Username = string.Empty;
            AppSettings.Password = string.Empty;
            AppSettings.LastUpdated = string.Empty;

            AppSettings.Save();

            this.DialogResult = false;
            this.Close();
        }
	}
}